<template>
  <div class="infomain">
    <el-container>
      <el-main>
        <ul>
          <li v-for="(item, index) in list" :key="item" @click="toview(index)">
            {{ item }}
          </li>
        </ul>
        <router-view />
      </el-main>
      <el-aside width="300px"><Aside /></el-aside>
    </el-container>
  </div>
</template>
    
<script  setup>
import {} from "vue";
import { useRouter } from "vue-router";
import { useStore } from "vuex";

import Aside from "@/view/main/cpn/aside";
const router = useRouter();
const store = useStore();
const list = ["问题", "回答", "文章", "关注", "收益", "我的文件"];
const toview = (index) => {
  console.log("00");
  if (index == 4) {
    index = "wallet";
  } else if (index == 5) {
    index = "file";
  }
  router.push({ path: `/details/${index}` });
  //发送网络请求
  store.dispatch("main/getattentions", index);
};
</script>
    
    <style scoped lang="less">
.infomain {
  margin-top: 10px;
  /deep/.el-container {
    .el-main {
      padding: 0;
      background: #ffffff;
      margin-right: 10px;
      > ul {
        padding: 0;
        border-bottom: 1px solid #f6f6f6;
        > li {
          padding: 0 10px 10px 10px;
          list-style: none;
          display: inline-block;
          cursor: pointer;
        }
      }
    }
  }
}
</style>
    